home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / ifl / iflConfig.z / iflConfig
Text File  |  1998-10-20  |  10KB  |  265 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllCCCCoooonnnnffffiiiigggg - class for pixel abstraction
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      This is a base class and therefore has no inheritance.
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <ifl/iflConfig.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The iflConfig class is used to describe the configuration of pixel data.
  19.      It is used in iflFile functions such as ggggeeeettttTTTTiiiilllleeee(((()))) and sssseeeettttTTTTiiiilllleeee(((()))) to
  20.      describe the configuration of data in the user's buffer.
  21.  
  22.      An iflConfig contains six public member variables describing a collection
  23.      of pixels:
  24.  
  25.  
  26.           iiiiffffllllTTTTyyyyppppeeee _d_t_y_p_e               Data type of the pixels
  27.  
  28.           iiiiffffllllOOOOrrrrddddeeeerrrr _o_r_d_e_r              Order of the pixels
  29.  
  30.           iiiiffffllllOOOOrrrriiiieeeennnnttttaaaattttiiiioooonnnn _o_r_i_e_n_t_a_t_i_o_n  Orientation of the pixels
  31.  
  32.           iiiinnnntttt _n_c_h_a_n_s                  Number of data channels the pixels
  33.                                       contain
  34.  
  35.           iiiinnnntttt _c_h_o_f_f                   Offset in the channel list for the
  36.                                       purpose of mapping from one collection
  37.                                       of channels to another.
  38.  
  39.           iiiinnnntttt**** _c_h_a_n_n_e_l_s               List that maps channels from one
  40.                                       collection to another.  This array is
  41.                                       not maintained by this object, the data
  42.                                       pointed to must persist while the object
  43.                                       is in use.
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))
  71.  
  72.  
  73.  
  74.      UUUUssssiiiinnnngggg iiiiffffllllCCCCoooonnnnffffiiiigggg
  75.  
  76.      The iflConfig object contains a list that maps channels from one
  77.      collection to another.  In this code fragment,
  78.  
  79.           unsigned char buffer[10*10*3];
  80.           static int list[] = { 2, 1, 0 };
  81.           iflConfig cfg(iflUChar, iflInterleaved, 3, list);
  82.  
  83.           someFile.getTile(0, 0, 0, 10, 10, 1, buffer, &cfg);
  84.  
  85.      _c_f_g is used to indicate that _b_u_f_f_e_r is going to receive a 10-by-10 array
  86.      of three-component  pixels stored in interleaved order with an unsigned
  87.      char data type.  This would override the actual configuration of the data
  88.      in _s_o_m_e_F_i_l_e.
  89.  
  90.      The channel list provides the buffer's channel information. The first
  91.      channel of the buffer receives data from channel 2 of _s_o_m_e_F_i_l_e. The
  92.      second channel is from _s_o_m_e_F_i_l_e's channel 1. The third buffer channel
  93.      gets channel 0 of _s_o_m_e_F_i_l_e.  In general, when an iflConfig is defaulted,
  94.      the operation being performed assumes that the source and destination
  95.      configurations match.  If _s_o_m_e_F_i_l_e was actually a four-channel float
  96.      image stored in separate order, then
  97.  
  98.           someFile.getTile(0, 0, 0, 10, 10, 1, buffer);
  99.  
  100.  
  101.      would require a buffer declared as
  102.  
  103.           float buffer[10*10*4];
  104.  
  105.      and would receive a verbatim copy of the requested section of _s_o_m_e_F_i_l_e.
  106.  
  107. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  108.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  109.  
  110.           iflConfig()
  111.           iflConfig(iflDataType type, iflOrder ord=iflInterleaved,
  112.                     int nchan=0, int* chanList=NULL, int chanOff=0,
  113.                     iflOrientation ori=iflOrientation(0))
  114.  
  115.  
  116.      CCCChhhhaaaannnnnnnneeeellll lllliiiisssstttt mmmmaaaannnniiiippppuuuullllaaaattttiiiioooonnnnssss
  117.  
  118.           void compose(int nc, int* in, int* out) const
  119.           int isInvertable() const
  120.           void invert(int nc, int* chanList) const
  121.           int mapChan(int idx) const
  122.           int operator[](int idx) const
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))
  137.  
  138.  
  139.  
  140. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  141.      iiiiffffllllCCCCoooonnnnffffiiiigggg(((())))
  142.  
  143.           iflConfig()
  144.           iflConfig(iflDataType type, iflOrder order=iflInterleaved,
  145.                     int nchan=0, int* chanList=NULL, int chanOff=0,
  146.                     iflOrientation ori=iflOrientation(0))
  147.  
  148.  
  149.           The first constructor creates an uninitialized object (not
  150.           recommended).  The second constructor creates an iflConfig with data
  151.           type, _t_y_p_e; data ordering, _o_r_d_e_r; and channel list defined by
  152.           _c_h_a_n_L_i_s_t of _n_c channels.  If _c_h_a_n_L_i_s_t is omitted, all _n_c_h_a_n channels
  153.           are used in ascending order.  Optionally, the orientation is set to
  154.           _o_r_i.  If omitted, the orientation matches that of the image being
  155.           accessed.
  156.  
  157.      ccccoooommmmppppoooosssseeee(((())))
  158.  
  159.           void compose(int nc, int* in, int* out) const
  160.  
  161.  
  162.           This function composes the channel list in the iflConfig object with
  163.           the channel list of _n_c_h_a_n channels specified by _i_n.  The composed
  164.           list is written to _o_u_t.
  165.  
  166.      mmmmaaaappppCCCChhhhaaaannnn(((())))
  167.  
  168.           void mapChan(int idx) const
  169.  
  170.  
  171.           This function returns the channel on the list in the iflConfig
  172.           object that maps to _i_d_x. It takes into account the offset specified
  173.           by _c_h_o_f_f, or just the offseted index, if the channel list is NULL.
  174.           If _i_d_x is more than _n_c_h_a_n_s or less than 0, it returns -1.
  175.  
  176.      ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](((())))
  177.  
  178.           void operator[](int idx) const
  179.  
  180.  
  181.           This operator returns the channel on the list in the iflConfig
  182.           object that maps to _i_d_x. It takes into account the offset specified
  183.           by _c_h_o_f_f, or just the offseted index, if the channel list is NULL.
  184.           If _i_d_x is more than _n_c_h_a_n_s or less than 0, it returns -1.
  185.  
  186.      iiiinnnnvvvveeeerrrrtttt(((())))
  187.  
  188.           void invert(int nc, int* chanList) const
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       iiiiffffllllCCCCoooonnnnffffiiiigggg((((3333))))
  203.  
  204.  
  205.  
  206.           This function inverts the channel list in the iflConfig object to
  207.           perform the mapping in the opposite direction.  The result is
  208.           written to _n_c entries of _c_h_a_n_l_i_s_t.
  209.  
  210.      iiiissssIIIInnnnvvvveeeerrrrttttaaaabbbblllleeee(((())))
  211.  
  212.           int isInvertable() const
  213.  
  214.  
  215.           This function returns whether the mapping described by the channel
  216.           list has an inverse.
  217.  
  218. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  219.      iflFile
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.